<?php
namespace app\admin\controller;
use app\common\controller\AdminBase;
use app\common\model\Uploads as UploadsModel;

class File extends AdminBase
{
    /**
     * 附件列表
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function index($limit = '20')
    {

        $model = new UploadsModel();
        $param = $this->request->param();
        if(!empty($param['keyword'])){
            $model = $model->where('file_name','like','%'.$param['keyword'].'%');
        }
        $lists = $model->order('id desc')->paginate($limit);
        $this->result(compact('lists'));
    }

}
